<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>固定定位</title>
  <style>
    div{
      width:200px;
      height:200px;
      background-color:red;
      position: fixed;
      right: 0;
      bottom: 0;
      z-index: 1;
    }
    p{
      height:1000px;

    }
    .p1{
      background-color: aqua;
    }
    .p2{
        position: relative;
      background-color: gold;
      z-index: 3;
    }
    .p3{
      background-color: hotpink;
    }
  </style>
</head>
<body>
<div></div>
<p class="p1"></p>
<p class="p2"></p>
<p class="p3"></p>

</body>
</html>